import fetch from 'utils/fetch';
import {
  getToken
} from 'utils/auth'
export function page(query) {
  return fetch({
    url: '/api/shop/categoryDetail/page',
    method: 'get',
    params: query
  });
}

export function save(data) {
  return fetch({
    url: '/api/shop/categoryDetail/save',
    method: 'post',
    data
  });
}

export function getDetail(categoryId) {
  return fetch({
    url: '/api/shop/categoryDetail/getDetail',
    method: 'get',
    params: { 'categoryId': categoryId }
  });
}

export function token() {
  return JSON.parse(getToken())
}
